import { createStore } from 'vuex'
import cart from './modiles/cart'
import user from './modiles/user'
import category from './modiles/category'
import createPersistedState from 'vuex-persistedstate'
export default createStore({
  modules: {
    cart,
    user,
    category
  },
  // 配置插件
  // 默认存储在localStorage
  plugins: [createPersistedState({
    // 本地存储名字
    key: 'erabbit-client-pc',
    paths: ['user', 'cart']
  })]
})
